package EBM.DB;

import java.sql.*;
import EBM.util.ParseProperties;


public class DBConnection {
	
	private static String dbUrl = ParseProperties.getProperties("dbUrl");
	private static String user = ParseProperties.getProperties("user");
	private static String password = ParseProperties.getProperties("password");

  
	public static Connection getConn()
	throws SQLException ,ClassNotFoundException{
		//加载SQL Server数据库驱动程序
		Class.forName("org.gjt.mm.mysql.Driver");
		//获得一个数据库连接
		Connection conn = DriverManager.getConnection(dbUrl,user,password);
		return conn;
	}

	public Connection getConnNew()
	throws SQLException ,ClassNotFoundException{
		//加载SQL Server数据库驱动程序
		Class.forName("org.gjt.mm.mysql.Driver");
		
		Connection conn = DriverManager.getConnection(dbUrl,user,password);
		return conn;
	}
}
